
import MaterialProperty from '../../MaterialProperty'

export default class CircleRaderDiffuseMaterialProperty extends MaterialProperty{
  constructor(options = {}) {
    super(options)
    this.repeat = options.repeat || 20.0
    this.offset = options.offset || 0.0
    this.thickness = options.thickness || 0.3
  }

  // 获取类型
  getType(time) {
    return Cesium.Material.CircleRaderDiffuseMaterialType
  }

  getValue(time, result) {
    if (!result) {
      result = {}
    }
    result.color = Cesium.Property.getValueOrUndefined(this.color, time)
    result.speed = Cesium.Property.getValueOrUndefined(this.speed, time)
    result.repeat = Cesium.Property.getValueOrUndefined(this.repeat, time)
    result.offset = Cesium.Property.getValueOrUndefined(this.offset, time)
    result.thickness = Cesium.Property.getValueOrUndefined(this.thickness, time)
    
    return result
  }
  
  equals(other) {
    return this === other
  }
}

Object.defineProperties(CircleRaderDiffuseMaterialProperty.prototype, {
  color: Cesium.createPropertyDescriptor('color'),
  speed: Cesium.createPropertyDescriptor('speed'),
  repeat: Cesium.createPropertyDescriptor('repeat'),
  offset: Cesium.createPropertyDescriptor('offset'),
  thickness: Cesium.createPropertyDescriptor('thickness')
})
